<?php
//RECQUIRES sqlControl.php
function ifDataExists($tableName, $whereClauseInput)
{
	$tables = array();
	$tables[0] = $tableName;
	
	$fields = array();
	$fields[0] = '*';
	
	$whereClause = $whereClauseInput;
	
	$data = SQLRecover($tables, $fields, $whereClause);
	
	if($data['queryStatus'] == 'DB Query success!')
	{
		return true;
	}
	return false;
}
function insertUpdate($tableName, $whereClause, $fields, $values)
{
	$data = (ifDataExists($tableName, $whereClause) ? $data = SQLUpdate($tableName, $whereClause, $fields, $values) : SQLInsert($tableName, $fields, $values));	
	return ($data['queryStatus'] == 'The query was saved successfully.' ? true : false);
}
?>